//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "datamodule.h"
#include "config.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "FIBDatabase"
#pragma link "pFIBDatabase"
#pragma link "pFIBErrorHandler"
#pragma resource "*.dfm"
TDataModule_tms *DataModule_tms;
//---------------------------------------------------------------------------
__fastcall TDataModule_tms::TDataModule_tms(TComponent* Owner)
        : TDataModule(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TDataModule_tms::DataModuleCreate(TObject *Sender)
{
   /*TIniFile *ini;
   ini = new TIniFile( ChangeFileExt( Forms::Application->ExeName, ".INI" ) );
   pFIBDatabase_tms->DBName=ini->ReadString( "Dir", "PathDB","");
   delete ini;
   */
   //pFIBDatabase_tms->SaveAliasParamsAfterConnect=true;
   //pFIBDatabase_tms->Connected=true;
   try
   {
   pFIBDatabase_tms->Open(true);
   }
   catch (...)
   {
     MessageBox(NULL,"error","!",MB_OK);
   } 

}


void __fastcall TDataModule_tms::pFibErrorHandler1FIBErrorEvent(
      TObject *Sender, EFIBError *ErrorValue, TKindIBError KindIBError,
      bool &DoRaise)
{
  char text[1024];
  sprintf(text,"May be not found GDS32.DLL in current place\r\n%s SQL code:%d ",
  ErrorValue->SQLMessage.c_str(),ErrorValue->SQLCode);
  MessageBox(NULL,text,"!",MB_OK);
  //FormConfig->ShowModal();
}
//---------------------------------------------------------------------------

